﻿$(function () {
    $(document.body).append("<form name='aa' method='post' id='myform'  action='/resgister.aspx' style='display:none;'><input type='hidden' name='orgid' /><input type='hidden' name='type' /></form>")
    $("#Register,.Register").click(function () { $("#myform").submit(); });
});
function orgRegister(oid, type) {
    $("#myform input[name='orgid']").val(oid);
    $("#myform input[name='type']").val(type);
};
function islogin() {
    if (readcookie("shequlogin") == "true")
        return true;
    else
        return false;
} 
function readcookie(name) {
    var reg = new RegExp(";?" + name + "=([^;]*)", '');
    var cookie = document.cookie;
    var values = cookie.match(reg);
    if (values == null)
        return "";
    return values[1];
}
function loginout() {
    location.href = "/default.aspx?loginout=" + Math.random();
}

function circleinit() {
    if (islogin() == true) {
        //$("#login").hide().after("<a href='/default.aspx?loginout=" + Math.random() + "'>退出</a>");
        $("[class='admqz clfix']").each(function (a, b) {
            $(b).click(function () {
                $("#group a[href*='circle/circlecontent.aspx']")[a].click();
            });
        });
        $("#userlogin,#login,#Register,.Register").hide();
        $("#userexit").show().click(function () { loginout(); });
    } else {
        $("#group a[href*='circle/circlecontent.aspx']").each(function (a, b) {
            $(b).attr({ urls: b.href, href: "javascript:void(0);", target: "_self" });
            $(b).live("click", function () { DaAn.Login($(this).attr("urls"));});
        });
        $("[class='admqz clfix']").each(function (a, b) {
            $(b).click(function () {$("#group a[urls]")[a].click(); });
        });
        $("#circlehot").attr({ urls: $("#circlehot").attr("href"), href: "javascript:void(0);", target: "_self" });
        $("#circlehot").live("click", function () { DaAn.Login($(this).attr("urls"));  });
    }
}